﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NoteBox
{
    public partial class Reminder : Form
    {
        public event dRem Remind;
        public int id;
        public int ID
        {
            get
            {
                return id;
            }
        }

        public Reminder(int _id,string title, string text, string time)
        {
            InitializeComponent();
            textBox1.Text = title;
            richTextBox1.Text = text;
            labelTime.Text = time;
            id = _id;
        }

        private void Reminder_Shown(object sender, EventArgs e)
        {
            Top = Screen.PrimaryScreen.WorkingArea.Height;
            Left = Screen.PrimaryScreen.WorkingArea.Width - Width;
            for (int i = 0; i < Height; i++)
            {
                Top--;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Remind(id,radioRepeat.Checked, (int)numericUpDownCount.Value, comboBoxType.Text);
            
            this.Dispose();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioOK.Checked)
            {
                numericUpDownCount.Enabled = false;
                comboBoxType.Enabled = false;
            }
            else
            {
                numericUpDownCount.Enabled = true;
                comboBoxType.Enabled = true;
            }
        }

        private void comboBoxType_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.KeyChar = Convert.ToChar(0);
        }
    }
}
